import request from '@/utils/request'


export default {
  getAll() {
    return request({
      url: '/middleware/getall',
      method: 'get',
    })
  },
  get(componentId) {
    return request({
      url: '/middleware/get/' + componentId,
      method: 'get',
    })
  },
  update(data) {
    return request({
      url: '/middleware/update',
      method: 'put',
      data
    })
  },
  create(data) {
    return request({
      url: '/middleware/create',
      method: 'post',
      data
    })
  },
  delete(id) {
    return request({
      url: '/middleware/delete/'+id,
      method: 'delete',
    })
  },
  copy(id) {
    return request({
      url: '/middleware/copy/'+id,
      method: 'post',
    })
  },
  execute(data) {
    return request({
      url: '/middleware/execute',
      method: 'post',
      data
    })
  }
}

